<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      /* 初始化 */
      * {
        margin: 0;
        padding: 0;
      }
      body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background-color: #000;
      }
      /* 设置立方体大小 */
      section {
        position: relative;
        width: 150px;
        height: 150px;
        /* 开启3D立体空间 */
        transform-style: preserve-3d;
        /* 使用动画 */
        animation: rotate 3s linear infinite;
      }
      /* 定义动画 */
      @keyframes rotate {
        0% {
          transform: rotateY(0) rotateX(0);
        }
        100% {
          transform: rotateY(360deg) rotateX(360deg);
        }
      }
      /* 设置图片的大小 */
      section img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transition: all 1s;
      }
      /* 设置图片的位置 */
      section img:nth-child(1) {
        transform: translateZ(75px);
      }
      section img:nth-child(2) {
        transform: rotateX(-180deg) translateZ(75px);
      }
      section img:nth-child(3) {
        transform: rotateX(90deg) translateZ(75px);
      }
      section img:nth-child(4) {
        transform: rotateX(-90deg) translateZ(75px);
      }
      section img:nth-child(5) {
        transform: rotateY(90deg) translateZ(75px);
      }
      section img:nth-child(6) {
        transform: rotateY(-90deg) translateZ(75px);
      }
      section img:nth-child(7) {
        transform: translateZ(75px);
      }
      section img:nth-child(8) {
        transform: rotateX(-180deg) translateZ(75px);
      }
      section img:nth-child(9) {
        transform: rotateX(90deg) translateZ(75px);
      }
      section img:nth-child(10) {
        transform: rotateX(-90deg) translateZ(75px);
      }
      section img:nth-child(11) {
        transform: rotateY(90deg) translateZ(75px);
      }
      section img:nth-child(12) {
        transform: rotateY(-90deg) translateZ(75px);
      }

      /* 鼠标悬停特效 */
      section:hover img:nth-child(1) {
        transform: translateZ(200px);
      }
      section:hover img:nth-child(2) {
        transform: rotateX(-180deg) translateZ(200px);
      }
      section:hover img:nth-child(3) {
        transform: rotateX(90deg) translateZ(200px);
      }
      section:hover img:nth-child(4) {
        transform: rotateX(-90deg) translateZ(200px);
      }
      section:hover img:nth-child(5) {
        transform: rotateY(90deg) translateZ(200px);
      }
      section:hover img:nth-child(6) {
        transform: rotateY(-90deg) translateZ(200px);
      }
    </style>
  </head>
  <body>
    <!-- 准备结构 -->
    <section>
      <img src="./3d/0.png" alt="" />
      <img src="./3d/1.png" alt="" />
      <img src="./3d/2.png" alt="" />
      <img src="./3d/4.png" alt="" />
	  <img src="./3d/5.png" alt="" />
      <img src="./3d/6.png" alt="" />
      <img src="./3d/0.jpg" alt="" />
      <img src="./3d/1.jpg" alt="" />
      <img src="./3d/2.jpg" alt="" />
      <img src="./3d/4.jpg" alt="" />
	  <img src="./3d/5.jpg" alt="" />
      <img src="./3d/6.jpg" alt="" />
      
    </section>
  </body>
</html>
